<template :page="page">
  <div class="page-box">
    <el-pagination
      class="pagination-vm"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="page.currentPage"
      :page-sizes="page.pageSizes"
      :page-size="page.pageSize"
      :layout="page.layout"
      :total="page.total"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "Pagination",
  props: {
    page: {
      type: Object,
      default() {
        return {
          layout: "total, sizes, prev, pager, next, jumper",
          currentPage: 1,
          pageSize: 10,
          pageSizes: [10],
          total: 1
        };
      }
    }
  },
  data() {
    return {};
  },
  methods: {
    handleSizeChange(val) {
      this.$emit("pageSizeChange", val);
    },
    handleCurrentChange(val) {
      this.$emit("pageCurrentChange", val);
    }
  }
};
</script>

<style lang="scss" scoped></style>
